// 树形数据展开
export const treeToArray = (tree: any[]): any[] => {
  return tree.reduce((res, item) => {
    const { children, ...i } = item
    return res.concat(
      i,
      children && children.length ? treeToArray(children) : [],
    )
  }, [])
}
